﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StandMeeting.aspx.cs" Inherits="Meeting.Web.Admin.MeetingStand.StandMeeting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>常设会议查询</title>
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <link rel="stylesheet" type="text/css" href="../../Css/main.css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
       <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <!--ardialog-->
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/plugins/iframeTools.js"></script>
    
    <script type="text/javascript" src="../../Scripts/common.js"></script>
    <script type="text/javascript">

        $(function () {
            if (request("psnID") == "") window.location = defaultUrl;
            //初始化列表
            $('#mainList').datagrid({
                url: 'StandMeetingOperation.ashx?method=GetStandMeeting',
                singleSelect: true,
                pagination: true, //是否开启分页
                pageNumber: 1, //默认索引页
                pageSize: 20, //默认一页数据条数
                collapsible: false
            });
            //设置分页
            var p = $("#mainList").datagrid("getPager");
            $(p).pagination({
                pageSize: 20, //每页显示的记录条数，默认为10   
                pageList: [10, 20, 30], //可以设置每页记录条数的列表   
                beforePageText: '第', //页数文本框前显示的汉字   
                afterPageText: '页    共 {pages} 页',
                displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'
            });
        });
        //
        function DoSearch() {
            $('#mainList').datagrid('load', {
                Name: $("#fName").val()
            });
        }
    </script>
      <style type="text/css">
          input{ height:18px;}
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="SearchTable">
            <tr>
                <td>
                    常设会议名称:
                </td>
                <td>
                    <input id="fName" style="width: 120px;" class="easyui-validatebox" />
                </td>
                <td>
                    <a href="#" class="easyui-linkbutton" onclick="DoSearch();">查询</a>
                </td>
            </tr>
        </table>
        <table id="mainList" class="easyui-datagrid" style="width: 1120px;">
            <thead>
                <tr>
                    <th data-options="field:'Id',hidden:true, width:120">
                        会议编号
                    </th>
                    <th data-options="field:'Name',width:120">
                        会议名称
                    </th>
                    <th data-options="field:'Comment',width:120">
                        备注信息
                    </th>
                    <th data-options="field:'IsActive',width:120,formatter:formatIsActive">
                        是否有效
                    </th>
                    <th data-options="field:'actionColumn',width:120,formatter:formatEmployee">
                        查看详情
                    </th>
                    <th data-options="field:'actionColumn2',width:120,formatter:formatDelete">
                        删除
                    </th>
                </tr>
            </thead>
        </table>
        <script type="text/javascript">
            function formatIsActive(val, row) {
                if (val ==  true ) {
                    return "有效";
                }
                return "无效";
            }
            function formatEmployee(val, row) {
                return "<a href='#' class='easyui-linkbutton' onclick=\"Show('" + row.Id + "');\"  >查看修改</a> ";
            }

            function Show(Id) { 
                var radStr = Math.random();
                var url = 'StandMeetingAdd.aspx?method=show&Id=' + Id + '&Radstr=' + radStr;
                art.dialog.open(url, {title:'常设会议信息',
                    id: 'AAA', width: 700, height: 530, lock: true,
                    close: function () { 
                    }
                }, false);
            }

            function formatDelete(val, row) {
                return "<a href='#' class='easyui-linkbutton' onclick=\"DeleteData('"+row.Id+"');\"  >删除</a> ";
            }

            function DeleteData(Id) {
                $.messager.confirm("询问", "该记录将被永久删除，确定吗？", function (c) {
                    if (!c) return;
                    var postData = { Id: Id };
                    $.post("StandMeetingOperation.ashx?method=DeleteStandMeeting", postData, function (data) {
                        if (data.success == true) {
                            $("#Id").val(data.Message); //成功后记录会议ID
                            $.messager.alert("提示", "删除成功");
                            $("#mainList").datagrid("reload");
                        } else {
                            $.messager.alert("提示", data.Message);
                        }
                    });
                });
            }
        </script>
    </div>
    </form>
</body>
</html>
